package com.example.zsf.presenter;

import com.example.zsf.base.Presenter;
import com.example.zsf.base.ZSFGlobal;
import com.example.zsf.network.Api;
import com.example.zsf.network.RetrofitManager;

import java.util.HashMap;

import retrofit2.Call;

public class MinePresenter extends Presenter {

    public static <T> Call<T> getMyFavorite(int page,PresenterListener<T> presenterListener) {
        Api api = RetrofitManager.getInstance()
                .setBaseUrl(ZSFGlobal.baseUrl)
                .build(Api.class);
        HashMap params = new HashMap();
        params.put("page", page);
        Call call = api.getMyFavorite(params);
        call.enqueue(new SampleCallback(presenterListener));
        return call;
    }


    public static <T> Call<T> getCollectRecord(int page,PresenterListener<T> presenterListener) {
        Api api = RetrofitManager.getInstance()
                .setBaseUrl(ZSFGlobal.baseUrl)
                .build(Api.class);
        HashMap params = new HashMap();
        params.put("page", page);
        Call call = api.getCollectRecord(params);
        call.enqueue(new SampleCallback(presenterListener));
        return call;
    }
}
